package demo;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 86183
 */
public class Login {
    private String name;
    private String password;

    public Login(String name, String password) {
        this.name = name;
        this.password = password;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }
    public void loginInfo(String name ,String password)throws NameException,PasswordException{
        if(!this.name.equals(name)){
            throw new NameException("名字错误异常");
        }
        if (!this.password.equals(password)){
            throw new PasswordException("密码错误异常");
        }
    }

}
